conditionals (not very elegant, but they work)

will probably fix the code a bit