kounoike's solution worked really well! thanks so much though to everybody who posted up solutions this has been giving me probs for the last couple of days!