Some fixing done

Found the synthax on subroutines, still gives wrong answer