simplified the structure due to many errors