added logic operations
added loop code generation