implemented function that returns first empty position on map