First pass at pure js