Issue ITTE-510

Solved tasks four and five, added tests to task three.