working on formattedTime
Added some parameters to formatTime