Version 3

cleaner code