cleaned up variables and structure