Fixed function bug and added variables