Implemented conditionals
minor bugfixes