Almost got procedure definitions working