A huge amount of changes, implementations and some typos corrections