Cleaned up the parseUP code