updated up() function
Minor fixes