Added some parameters

Also did some code fixes