added lot's of conditional statements