Working version almost finished