experimented with different ways in writing class functions