changed hash map to if conditions