Cleaned up variables and functions