changed some var names and types