final version before attempting adding ending and bug fixes