adding 'sleep' command
improvements to basename and dirname