Assignment 1; pascal working, rest un-tested