some intentation for readability. still code is ugly