cleaned up vars, fixed up resources