remove a smaller bug, have a new look on the code