finished but code is spaghetti code