Most of code is functioning