removed old code
added register fn