fix checking of commands number
fix functions renaming and style
fix converting code to commands
update TODO list