enhanced to complete functionality