Removed unnessocry functions in misc_tools +added pseduocode