fixed some methods and main