yeah, finally the code. Although incomplete