fixed warnings and errors related to scope of variables and methods, need bracers, parameters should be final, method is not designed for extension