added logging - removed some useless line code