hardware layer written completly