Fixed issue, added more variables and functions