Replace explicit local variable declare with implicit
Removed strict comparison with floating point numbers, replaced with cast to int
Removed potential twice enumeration (as ReSharper suggests)
Clear code: removed unused "using", braces and other redundant stuff that does not affects functionality
Fixed error