fixed implementation of end prog
proper function generation in compiler
added function jumps