typecheck complete + some hierarchy changes to programs