programming assignment 2 by Sergey Vash