moved back to the first implementation
back to original bad code (that works)