let's just hope it compiles

it does not look pretty, but if it works, thanks God! There may be some typos now...