Updated version, tidying