better variable scope and type detection
declare console global
better tests
better tests