Reverted the very original code, before attempting to mimic the tools avaliable with functions