My spagetti code