Features added, bugs fixed

add function calls, imports and so on
fix some errrors
add indentation