added methods to Snake class