Adding conditionals for functions & syntax improvements