Bills get win for Hamlin