Fixed all naming and other bugs. Working version