This is a working copy of basic functions. only begin-end and nested while aren't working.