First crack ad improving the code