updated - fnished basic implementation