main 99% converted. working on controller