sorry, it must have taken hours to come to this code... :P