Some basic improvments to help the code work...