Change program structure

Signed-off-by: Andrew Tselischev <andrewtselischev@gmail.com>
Solved B, working on C (01/24/2013)

Signed-off-by: Andrew Tselischev <andrewtselischev@gmail.com>