tidied up code.. also tying to fix submit