@Issue4: Fixed the Rest by implementing the duration method

Edited by @jinpan and @ryanalex