make code compile on mac
implement conditionals