Updated marks function with mac os specific commands